//package com.qiaodata.datatrans.web;
//
//import com.alibaba.fastjson.JSONObject;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import com.qiaodata.datatrans.dao.TransRecordExtDao;
//import com.qiaodata.datatrans.model.TransRecord;
//import com.qiaodata.datatrans.model.query.TransRecordExample;
//import com.qiaodata.datatrans.service.TransRecordService;
//import com.qiaodata.datatrans.utils.JsonRet;
//import com.qiaodata.datatrans.utils.StringUtil;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//@RestController
//@RequestMapping("/transRecord")
//@Slf4j
//public class TransRecordController {
//
//
//	@Autowired
//	private TransRecordService transRecordService;
//	@Autowired
//	private TransRecordExtDao transRecordExtDao;
//
//	@ApiOperation("统计查询或导入总数据")
//	@RequestMapping(value = "getCountAskOrImport", method = RequestMethod.POST)
//	public Object getCountAskOrImport(@ApiParam(required = true, name = "state", value = "ask还是import，ask为0，import为1") @RequestParam("state") String state) {
//		if (state==null) {
//			return JsonRet.getInstance("输入参数只能是0或1，请检查输入参数！");
//		}
//		if ("0".equals(state.trim())) {
//			Long countAskOrImport = transRecordExtDao.getCountAskOrImport(state);
//			return JsonRet.getInstance("ask请求总次数：", countAskOrImport);
//		} else if ("1".equals(state.trim())) {
//			Long countAskOrImport = transRecordExtDao.getCountAskOrImport(state);
//			return JsonRet.getInstance("import导入总条数：", countAskOrImport);
//		} else {
//			return JsonRet.getInstance("输入参数只能是0或1，请检查输入参数！");
//		}
//	}
//
//	@ApiOperation("选择时间统计查询或导入总数据")
//	@RequestMapping(value = "getCountAskOrImportByDate", method = RequestMethod.POST)
//	public Object getCountAskOrImportByDate(@ApiParam(required = true, name = "state", value = "ask还是import，ask为0，import为1") @RequestParam("state") String state,
//											@ApiParam(required = true, name = "startTime", value = "起始时间，形式xxxx-xx-xx") @RequestParam("startTime") String startTime,
//											@ApiParam(required = true, name = "endTime", value = "结束时间，形式xxxx-xx-xx") @RequestParam("endTime") String endTime) {
//		if (StringUtil.isEmpty(state) || StringUtil.isEmpty(startTime) || StringUtil.isEmpty(endTime)) {
//			return JsonRet.getInstance("输入参数格式错误，请检查输入参数！");
//		}
//		try {
//			if ("0".equals(state.trim())) {
//				Long countAskOrImport = transRecordExtDao.getCountAskOrImportByDate(state, startTime, endTime);
//				return JsonRet.getInstance("ask时间范围内请求总次数：", countAskOrImport);
//			} else if ("1".equals(state.trim())) {
//				Long countAskOrImport = transRecordExtDao.getCountAskOrImportByDate(state, startTime, endTime);
//				return JsonRet.getInstance("import时间范围内导入总条数：", countAskOrImport);
//			} else {
//				return JsonRet.getInstance("输入参数错误，请检查输入参数！");
//			}
//		} catch (Exception e) {
//			return JsonRet.getInstance("输入时间格式错误，请检查输入参数！");
//		}
//
//	}
//
////	@RequestMapping(value = "getByJson", method = RequestMethod.POST)
////	public Object getByJson(@RequestBody JSONObject jsonObject) {
////		if (jsonObject==null || "".equals(jsonObject.toString())) {
////			return "参数为空";
////		}
////
//////		String[] split = jsonObject.toString().split("P_PersonalInformation\":");
//////		String[] split1 = split[1].split("P_Resume\":");
//////		String p1 = split1[0].substring(0, split1[0].length() - 2);
//////		String p2 = split1[1].substring(0, split1[1].length() - 1);
//////		System.out.println(p1);
//////		System.out.println(p2);
////
////		Map<String, String> map = getJson(jsonObject);
////		String p1 = map.get("P_PersonalInformation");
////		String p2 = map.get("P_Resume");
////
////		JSONObject parse = (JSONObject) JSONObject.parse(p1);
////		String email = (String) parse.get("Email");
////
////		return email;
////	}
////
////	private Map<String, String> getJson(JSONObject jsonObject) {
////		Map<String, String> map = new HashMap<>();
////		if (jsonObject==null || "".equals(jsonObject.toString())) {
////			map.put("P_PersonalInformation", "");
////			map.put("P_Resume", "");
////			return map;
////		}
////		String[] split = jsonObject.toString().split("P_PersonalInformation\":");
////		if (split.length<2) {
////			map.put("P_PersonalInformation", "");
////			map.put("P_Resume", "");
////			return map;
////		}
////		String[] split1 = split[1].split("P_Resume\":");
////		if (split1.length<2) {
////			map.put("P_PersonalInformation", "");
////			map.put("P_Resume", "");
////			return map;
////		}
////		String p1 = split1[0].substring(0, split1[0].length() - 2);
////		String p2 = split1[1].substring(0, split1[1].length() - 1);
////		map.put("P_PersonalInformation", p1);
////		map.put("P_Resume", p2);
////		return map;
////	}
//
//}
